import torch

a = torch.rand(2, 3)
b = torch.rand(2, 3)

print(a) # ==> tensor([[0.6037, 0.4861, 0.6106],[0.0133, 0.5217, 0.1545]])
print(b) # ==> tensor([[0.1886, 0.9000, 0.0076],[0.1806, 0.6637, 0.4445]])

'''a和b是否相等'''
print(torch.eq(a, b)) # ==> tensor([[False, False, False],[False, False, False]])

'''a和b是否完全相等'''
print(torch.equal(a, b)) # ==> False

'''a是否大于等于b'''
print(torch.ge(a, b)) # ==> tensor([[ True, False,  True],[False, False, False]])

'''a是否大于b'''
print(torch.gt(a, b)) # ==> tensor([[ True, False,  True],[False, False, False]])

'''a是否小于等于b'''
print(torch.le(a, b)) # ==> tensor([[False,  True, False],[ True,  True,  True]])

'''a是否不等于b'''
print(torch.ne(a, b)) # ==> tensor([[True, True, True],[True, True, True]])